package gui;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.wb.swt.SWTResourceManager;

import data.model.ProjectWeek;

public class ProjectWeekComposite extends Composite {

	private final ProjectWeek projectWeek;

	/**
	 * Create the composite.
	 * 
	 * @param parent
	 * @param style
	 */
	public ProjectWeekComposite(Composite parent, int style,
			ProjectWeek projectWeek) {
		super(parent, style);
		if (projectWeek == null) {
			throw new IllegalArgumentException("projectWeek must not be null");
		}
		this.projectWeek = projectWeek;
		setLayout(new GridLayout(1, false));

		Label lblTopic = new Label(this, SWT.NONE);
		lblTopic.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 2,
				1));
		lblTopic.setFont(SWTResourceManager.getFont("Segoe UI", 12, SWT.BOLD));
		lblTopic.setText(projectWeek.getProject().getId() + " - Week "
				+ projectWeek.getWeekNumber());

		Composite projectDataComposite = new ProjectDataComposite(this,
				SWT.NONE, projectWeek, null);
		projectDataComposite.setLayoutData(new GridData(SWT.LEFT, SWT.TOP,
				true, true, 1, 1));

	}
}
